import Vue from 'vue';
import Router from 'vue-router';

import reg from '@/components/register/reg';    //注册  
import login from '@/components/login/login';    //登录  
import homepage from '@/components/homepage/homepage';  //主页 
import findpassword from '@/components/findpassword/findpassword';    //找回密码 

import system from '@/components/systemSetup/system';    //系统设置(商户资料) 
import systemSafe from '@/components/systemSetup/systemSafe';    //系统设置(安全设置) 
import systemStockAlert from '@/components/systemSetup/systemStockAlert';    //系统设置(库存预警设置) 
import recommend from '@/components/systemSetup/recommend';    //系统设置(我要推荐) 
import recommends from '@/components/systemSetup/recommends';    //系统设置(推荐管理)
import about from '@/components/systemSetup/about';    //系统设置(关于我们)

import sale from '@/components/finance/sale';   //财务管理 (销售统计)
import income from '@/components/finance/income';   //财务管理 (收入统计)
import expenditure from '@/components/finance/expenditure';   //财务管理 (支出统计)
import integral from '@/components/finance/integral';   //财务管理 (积分统计)
import redpacket from '@/components/finance/redpacket';   //财务管理 (红包统计)

import allorders from '@/components/orderManagement/agent/allorders';    //订单管理(全部订单 001 002) 
// allorders/all 全部订单   allorders/unconfirmed 未确认订单    allorders/pendingdelivery 待发货订单   allorders/alreadyshipped 已发货订单  allorders/settled 待结算订单  allorders/settleds 已结算订单
import orderdetails from '@/components/orderManagement/agent/orderDetails';    //订单管理(订单详情 002) 



import departments from '@/components/employee/agent/department';  //员工管理(部门管理 001) 
import employees from '@/components/employee/agent/employee';  //员工管理(员工管理 002) 
import adddepartment from '@/components/employee/agent/adddepartment';  //员工管理(新增部门 001) 
import addemployee from '@/components/employee/agent/addemployee';  //员工管理(新增员工 001)  
import editdepartment from '@/components/employee/agent/editdepartment';  //员工管理(编辑部门 001)  
import editemployee from '@/components/employee/agent/editemployee';  //员工管理(编辑部门 001)  


import wealthmain from '@/components/wealthManagement/wholesaler/wealthMain';  //钱包管理-首页(001批发商) 
import balancedetail from '@/components/wealthManagement/wholesaler/balanceDetail';  //钱包管理-余额明细(001批发商) 
import integraldetail from '@/components/wealthManagement/wholesaler/integralDetail';  //钱包管理-积分明细(001批发商) 
import redenvelopedetail from '@/components/wealthManagement/wholesaler/redEnvelopeDetail';  //钱包管理-红包明细(001批发商) 
import rechargedetail from '@/components/wealthManagement/wholesaler/rechargeDetail';  //钱包管理-充值明细(001批发商) 
import withdrawaldetail from '@/components/wealthManagement/wholesaler/withdrawalDetail';  //钱包管理-提现明细(001批发商) 
import rolloutdetail from '@/components/wealthManagement/wholesaler/rolloutDetail';  //钱包管理-转出明细(001批发商) 
import loandetail from '@/components/wealthManagement/wholesaler/loanDetail';  //钱包管理-货款明细(001批发商) 
import informationcostsdetail from '@/components/wealthManagement/wholesaler/informationcostsdetail';  //钱包管理-信息费明细(001批发商) 
import clientlist from '@/components/customerManagement/agent/clientList';  //客户管理-客户列表 (001 002)
import customertransactions from '@/components/customerManagement/agent/customerTransactions';  //客户管理-客户交易管理  (001 002)

import quality from '@/components/quality/quality'; //质量管理

import agentadddrug from '@/components/drugManagment/agent/adddrug';  //新增药品(001批发商【药品管理】) 
import drugListAi from '@/components/drugManagment/agent/drugListAi';  //(001批发商【药品管理】)
//进货管理  druglistai/stockmanagement
// 药品列表：druglistai/druglist  已删除药品：druglistai/deleteddrugs  //已上架 druglistai/shangjia  //已下架 druglistai/xiajia
//缺货药品：druglistai/shortageofdrugs  //库存预警：druglistai/lackdrug  //即将过期:druglistai/willexpire  //已过期：druglistai/expired  
import stockmanagement from '@/components/drugManagment/agent/stockmanagement'; //(001批发商【药品管理】)
//进货管理:/stockmanagement
import productcategorymgmt from '@/components/drugManagment/agent/productCategoryMgmt/productCategoryMgmt'; //(001批发商【药品管理】)
//产品种类管理一级分类:/productcategorymgmt
import leveltwo from '@/components/drugManagment/agent/productCategoryMgmt/levelTwo'; //(001批发商【药品管理】)
//产品种类管理二级分类:/productcategorymgmt/leveltwo
import levelthree from '@/components/drugManagment/agent/productCategoryMgmt/levelThree'; //(001批发商【药品管理】)
//产品种类管理三级分类:/productcategorymgmt/leveltwo/levelthree
import brandlibrary from '@/components/drugManagment/agent/brandLibrary'; //(001批发商【药品管理】)
//品牌库:/brandlibrary

import mall from '@/components/mall/index';  //批发商城首页  （商城管理002店铺）
import mallOrder from '@/components/mall/order'  //批发商城订单 （商城管理002店铺）
//all 全部订单  paid 待支付  acceptance 待受理  delivery 待发货  deliverys 待发货 sign  待签收  settlement 已结算 （商城管理002店铺）
import mallOrderDetails from '@/components/mall/orderDetails'  //批发商城订单详情 （商城管理002店铺）
import mallOpinion from '@/components/mall/opinion'  //批发商城 意见反馈  // complaint 投诉    proposal 建议 （商城管理002店铺）
import cart from '@/components/mall/cart';  //批发进货单 （商城管理002店铺）
import detail from '@/components/mall/detail';  //商品详情页 （商城管理002店铺）
import favoriteproduct from '@/components/mall/favoriteProduct';  //收藏产品 （商城管理002店铺）
import favoritestore from '@/components/mall/favoriteStore';  //收藏店铺 （商城管理002店铺）
import mallSearch from '@/components/mall/search';  //搜索结果页 （商城管理002店铺）
import msg from '@/components/mall/msg';  //消息列表页 （商城管理002店铺）
import mallStoreIndex from '@/components/mall/mallStoreIndex';  //店铺首页 （商城管理002店铺）
import mallStoreAllProduct from '@/components/mall/mallStoreAllProduct';  //店铺所有商品 （商城管理002店铺）
import mallStoreArchives from '@/components/mall/mallStoreArchives';  //店铺所有商品 （商城管理002店铺）
import mallpay from '@/components/mall/pay';  //支付页面 （商城管理002店铺）


import mallStoreMgmt from '@/components/mallMgmt/agent/mallStoreMgmt';  //店铺管理（商城管理001批发商）
//pc店铺管理： /mallStoreMgmt/pc    手机店铺管理：/mallStoreMgmt/sj
import mallProductMgmt from '@/components/mallMgmt/agent/mallProductMgmt';  //专场（商城管理001批发商）
// 儿童专场:/mallproductmgmt/childrens    老人专场：/mallproductmgmt/elders   推荐药品：/mallproductmgmt/rcddrugs


import relations from '@/components/relations/relations';  //资讯公告
import relationsList from '@/components/relations/relationsList';  //系统公告列表
import relationsDetail from '@/components/relations/relationsDetail';  //系统公告详情页


import nodatapage from '@/components/nodatapage';  //404（通用）

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: login,
      meta: {
        keepAlive: false // 不需要缓存
      }
    },
    {
      path: '/reg',
      name: 'reg',
      component: reg,
      meta: {
        keepAlive: false // 不需要缓存
      }
    },
    {
      path: '/homepage',
      name: 'homepage',
      component: homepage,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/agentadddrug/:coding/:ppath',
      name: 'agentadddrug',
      component: agentadddrug,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/findpassword',
      name: 'findpassword',
      component: findpassword,
      meta: {
        keepAlive: false // 不需要缓存
      }
    },
    {
      path: '/system',
      name: 'system',
      component: system,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/systemSafe',
      name: 'systemSafe',
      component: systemSafe,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/systemStockAlert',
      name: 'systemStockAlert',
      component: systemStockAlert,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/allorders/:id',
      component: allorders,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/orderdetails/:id/:oid',   
      name: 'orderdetails',
      component: orderdetails,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/recommend',
      name: 'recommend',
      component: recommend,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/recommends',
      name: 'recommends',
      component: recommends,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/about',
      name: 'about',
      component: about,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/addemployee',
      component: addemployee,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/adddepartment',
      component: adddepartment,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/employees',
      component: employees,
      meta: {
        keepAlive: true // 缓存  
      }
    },
    {
      path: '/departments',
      component: departments,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/editdepartment/:id',
      component: editdepartment,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/editemployee/:id',
      component: editemployee,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/wealthmain',
      name: 'wealthmain',
      component: wealthmain,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/balancedetail',
      name: 'balancedetail',
      component: balancedetail,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/integraldetail',
      component: integraldetail,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/integraldetail',
      name: 'integraldetail',
      component: integraldetail,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/redenvelopedetail',
      name: 'redenvelopedetail',
      component: redenvelopedetail,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/rechargedetail',
      name: 'rechargedetail',
      component: rechargedetail,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/withdrawaldetail',
      name: 'withdrawaldetail',
      component: withdrawaldetail,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/loandetail',
      name: 'loandetail',
      component: loandetail,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/informationcostsdetail',
      name: informationcostsdetail,
      component: informationcostsdetail,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/rolloutdetail',
      name: rolloutdetail,
      component: rolloutdetail,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/clientlist',
      name: 'clientlist',
      component: clientlist,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/customertransactions',
      name: 'customertransactions',
      component: customertransactions,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/druglistai/:id',
      component: drugListAi,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/stockmanagement',
      component: stockmanagement,
      meta: {
        keepAlive: true // 缓存
      }
    },
    {
      path: '/brandlibrary',
      component: brandlibrary,
      meta: {
        keepAlive: true // 缓存  
      }
    },
    {
      path: '/productcategorymgmt',
      component: productcategorymgmt,
      meta: {
        keepAlive: true // 缓存
      },
    },
    {
      name: 'agentLevelTwo',
      path: '/productcategorymgmt/leveltwo/:pid',
      component: leveltwo,
      meta: {
        keepAlive: true // 缓存
      },
    },
    {
      name: 'agentLevelThree',
      path: '/productcategorymgmt/leveltwo/levelthree/:pid/:topid',
      component: levelthree,
      meta: {
        keepAlive: true // 缓存
      },
    },
    {
      name: 'mallStoreMgmt',
      path: '/mallstoremgmt/:id',
      component: mallStoreMgmt,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/mallproductmgmt/:id',
      component: mallProductMgmt,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    //批发商城开始
    {
      path: '/mall',
      component: mall,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/mallOrder/:id',
      component: mallOrder,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/cart',
      component: cart,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/mallOrderDetails/:id',
      component: mallOrderDetails,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/detail',
      component: detail,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/mallOpinion/:id',
      component: mallOpinion,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/favoriteproduct',
      component: favoriteproduct,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/favoritestore',
      component: favoritestore,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/mallsearch',
      component: mallSearch,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/msg',
      component: msg,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/mallStoreindex',
      component: mallStoreIndex,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/mallStoreAllProduct',
      component: mallStoreAllProduct,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/mallStoreArchives',
      component: mallStoreArchives,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/sale',
      component: sale,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/income',
      component: income,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/expenditure',
      component: expenditure,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/integral',
      component: integral,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/redpacket',
      component: redpacket,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/mallpay',
      component: mallpay,
      meta: {
        keepAlive: true // 缓存  
      },
    },
    {
      path: '/quality',
      component: quality,
      meta: {
        keepAlive: true // 缓存   
      },
    },
    {
      path: '/relations',
      component: relations,
      meta: {
        keepAlive: true // 缓存    
      },
    },
    {
      path: '/relationsList/:id',
      component: relationsList,
      meta: {
        keepAlive: true // 缓存    
      },
    },
    {
      name:'detailstxt',
      path: '/relationsDetail/:id',
      component: relationsDetail,
      meta: {
        keepAlive: true // 缓存    
      },
    },
    {
      path: '*',  //404
      name: nodatapage,
      component: nodatapage,
      meta: {
        keepAlive: false // 缓存    
      },
    },
  ]
})













